//
//  MainViewController.m
//  07-UITabBarController-拉勾
//
//  Created by LL.F on 16/7/23.
//  Copyright © 2016年 LL.F. All rights reserved.
//

#import "MainViewController.h"
#import "FLLView.h"
#import "LoginViewController.h"
#define kScreenbounds [UIScreen mainScreen].bounds
#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kScreenHeight  [UIScreen mainScreen].bounds.size.height
@interface MainViewController ()
@property (nonatomic, strong) UIImageView *loginAndRegisterImageView;
@property (nonatomic, strong) UILabel *loginAndRegisterLabel;
@property (nonatomic, strong) UILabel *longLabel;
@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationController.navigationBarHidden = YES;
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.00 green:0.71 blue:0.55 alpha:1.00];
    self.view.backgroundColor = [UIColor colorWithRed:0.94 green:0.95 blue:0.96 alpha:1.00];
    
    // 修改标题字体颜色和大小
//    self.navigationController.navigationBar setTitleTextAttributes:@{};
    
    // 绿色视图
    UIView *mainView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 200)];
    mainView.backgroundColor = [UIColor colorWithRed:0.00 green:0.71 blue:0.55 alpha:1.00];
    [self.view addSubview:mainView];
    
    // 登录注册图片
    self.loginAndRegisterImageView = [[UIImageView alloc] initWithFrame:CGRectMake(145, 34, 85, 84)];
    _loginAndRegisterImageView.backgroundColor = [UIColor whiteColor];
    _loginAndRegisterImageView.image = [UIImage imageNamed:@"mainImage"];
    _loginAndRegisterImageView.layer.cornerRadius = 42;
    _loginAndRegisterImageView.layer.masksToBounds = YES;
    // 轻拍手势
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didClickedLoginAndRegisterImage:)];
    [_loginAndRegisterImageView addGestureRecognizer:tap];
    [self.view addSubview:_loginAndRegisterImageView];
    
    // 登录注册label
    self.loginAndRegisterLabel = [[UILabel alloc] initWithFrame:CGRectMake(145, 125, 90, 30)];
    _loginAndRegisterLabel.text = @"登录/注册";
    _loginAndRegisterLabel.textAlignment = 1;
//    _loginAndRegisterLabel.backgroundColor = [UIColor blackColor];
    _loginAndRegisterLabel.textColor = [UIColor whiteColor];
    _loginAndRegisterLabel.font = [UIFont boldSystemFontOfSize:20];
    [self.view addSubview:_loginAndRegisterLabel];
    
    // 长label
    self.longLabel = [[UILabel alloc] initWithFrame:CGRectMake(120, 160, 150, 30)];
    _longLabel.textAlignment = 1;
    _longLabel.text = @"职场从来没有过客";
    _longLabel.textColor = [UIColor whiteColor];
    _longLabel.font = [UIFont systemFontOfSize:14];
//    _longLabel.backgroundColor = [UIColor blackColor];
    [self.view addSubview:_longLabel];
    
    
    // 简历
    FLLView *remuse = [[FLLView alloc] initWithFrame:CGRectMake(0, 200, kScreenWidth, 64)];
//    remuse.backgroundColor = [UIColor blackColor];
    remuse.iconImageView.image = [UIImage imageNamed:@"remuse"];
    remuse.titleLabel.text = @"简历";
    [self.view addSubview:remuse];
    
    // PLUS
    FLLView *PLUS = [[FLLView alloc] initWithFrame:CGRectMake(0, 200 + 64, kScreenWidth, 64)];
    PLUS.iconImageView.image = [UIImage imageNamed:@"PLUS"];
    PLUS.titleLabel.text = @"PLUS";
    PLUS.linView.backgroundColor = nil;
    [self.view addSubview:PLUS];
    
    // 收藏
    FLLView *favourite = [[FLLView alloc] initWithFrame:CGRectMake(0, 200 + 64 * 2 + 10, kScreenWidth, 64)];
    favourite.iconImageView.image = [UIImage imageNamed:@"favourite"];
    favourite.titleLabel.text = @"收藏";
    [self.view addSubview:favourite];
    
    // 意见反馈
    FLLView *suggest = [[FLLView alloc] initWithFrame:CGRectMake(0, 200 + 64 * 3 + 10, kScreenWidth, 64)];
    suggest.iconImageView.image = [UIImage imageNamed:@"suggest"];
    suggest.titleLabel.text = @"意见反馈";
    [self.view addSubview:suggest];
    
    // 设置
    FLLView *setting = [[FLLView alloc] initWithFrame:CGRectMake(0, 200 + 64 * 4 + 10, kScreenWidth, 64)];
    setting.iconImageView.image = [UIImage imageNamed:@"setting"];
    setting.titleLabel.text = @"设置";
    setting.linView.backgroundColor = nil;
    [self.view addSubview:setting];
    
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{

    LoginViewController *lvc = [[LoginViewController alloc] init];
    [self presentViewController:lvc animated:YES completion:nil];
}
#pragma mark -登录/注册界面轻拍手势
- (void)didClickedLoginAndRegisterImage:(UITapGestureRecognizer *)tap
{

    LoginViewController *lvc = [[LoginViewController alloc] init];
    [self presentViewController:lvc animated:YES completion:nil];
    NSLog(@"ljid");
}

- (UIStatusBarStyle)preferredStatusBarStyle {
    
//    if (self.buttonOfChange.isSelected) {
//        
//        return UIStatusBarStyleDefault;
//        
//    } else {
//        
//        // 亮色.
        return UIStatusBarStyleLightContent;
//    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
